﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using DataAccess;
using Entity;

namespace Bussiness
{
    public class CommentBll
    {
        private CommentDao _commentDao;

        public bool AddComment(Comment comment)
        {
            _commentDao = new CommentDao();
            int result = _commentDao.AddComment(comment);
            return (result != 0);
        }

        public DataSet GetCommentByPostId(int postId)
        {
            _commentDao = new CommentDao();
            return _commentDao.GetCommentByPostId(postId);
        }

        public DataSet GetCommentById(int commentId)
        {
            _commentDao = new CommentDao();
            return _commentDao.GetCommentById(commentId);
        }

        public DataSet GetCommentFromDate(DateTime fromDate)
        {
            _commentDao = new CommentDao();
            return _commentDao.GetCommentFromDate(fromDate);
        }

        public DataSet GetAllComment()
        {
            _commentDao = new CommentDao();
            return _commentDao.GetAllComment();
        }


        public bool AdminPublishComment(int commentId,string commentNote)
        {
            _commentDao = new CommentDao();
            int result = _commentDao.AdminPublishComment(commentId, commentNote);
            return (result != 0);
        }
    }
}
